//
//  QDUMEvent.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/4/20.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit

/// 统计事件埋点
enum QDUMEvent: String {

    /// 主页的顶部轮播图
    case homeTop = "100"
    /// 主页的广告位
    case homeAd = "101"
    /// 站点信息
    case station = "102"
    /// 乘客服务
    case userService = "103"
    /// 在线购票
    case buyTicket = "104"
    /// 乘车安全
    case safeRiding = "105"
    /// 票务信息
    case ticketMessage = "106"
    /// 出行指南
    case outGuide = "107"
    /// 常见问题
    case commonQuestion = "108"
    
    
    /// 资讯的顶部轮播
    case newsTop = "200"
    /// 资讯界面
    case news = "201"
    

    /// 地铁二维码界面的广告
    case metroCodeAd = "300"

    /// 生活圈顶部轮播
    case lifeTop = "400"
    /// 生活圈界面
    case life = "401"


    /// 验证码登陆
    case login = "500"


    /// 签约微信
    case signWeixin = "600"
    /// 签约支付宝
    case signALi = "601"
    /// 签约银联
    case signUnion = "602"

}

/// 用于友盟统计事件的管理
final class QDUMEventManager: NSObject {

    @objc static func eventObjc(event: String){
        MobClick.event(event)
    }
    
    /// 进行统计
    static func event(event: QDUMEvent, info: [AnyHashable: Any] = [AnyHashable: Any]()){
        MobClick.event(event.rawValue, attributes: info)
    }
}
